package main

import (
	"fmt"
	grpc2 "gitee.com/xuxinzhi2206/corehub/grpc"
	"gitee.com/xuxinzhi2206/corehub/nacos"
	viper2 "gitee.com/xuxinzhi2206/corehub/viper"
	"goods-rpc/internal/api"
	"goods-rpc/models"
	"goods-rpc/pkg"
	"google.golang.org/grpc"
)

func main() {
	err := viper2.GetViper("./config.yaml")
	if err != nil {
		return
	}
	err = models.AutoMigrate()
	if err != nil {
		return
	}
	getConfig, err := nacos.GetConfig()
	if err != nil {
		return
	}
	fmt.Println(getConfig)
	pkg.ZapClient()
	err = grpc2.RegisterRPC(func(s *grpc.Server) {
		api.RegisterRpc(s)
	})
	if err != nil {
		return
	}
}
